package com.nextbusmn.server.dataobjects;

import java.util.Date;

import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class StopTimeData implements NextBusData {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	private BusTripData trip;
	
	@Persistent
	private String tripID;
	
	@Persistent
	private Date arrivalTime;
	
	@Persistent
	private Date departureTime;
	
	@Persistent
	private int stopID;
	
	@Persistent
	private int serviceType;
	
	@Persistent
	private int stopSequence;
	
	@Persistent
	private BusStopData stop;
	
	public StopTimeData(String tripID,
						Date arrivalTime,
						Date departureTime,
						int stopID,
						int stopSequence,
						BusTripData trip) {
		this.tripID = tripID;
		this.arrivalTime = arrivalTime;
		this.departureTime = departureTime;
		this.stopID = stopID;
		this.stopSequence = stopSequence;
		this.trip = trip;
		this.serviceType = trip.getServiceType();
		this.stop = null;
	}
	
	public BusStopData getBusStop() {  //######################3
		return stop;
	}
	
	public void setBusStop(BusStopData stop) { //######################
		this.stop = stop;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public Date getArrivalTime() {
		return arrivalTime;
	}

	public void setArrivalTime(Date arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	public Date getDepartureTime() {
		return departureTime;
	}

	public void setDepartureTime(Date departureTime) {
		this.departureTime = departureTime;
	}

	public int getStopSequence() {
		return stopSequence;
	}

	public void setStopSequence(int stopSequence) {
		this.stopSequence = stopSequence;
	}

	public BusTripData getTrip() {
		return trip;
	}

	public void setTrip(BusTripData trip) {
		this.trip = trip;
	}

	public String getTripID() {
		return tripID;
	}

	public void setTripID(String tripID) {
		this.tripID = tripID;
	}

	public int getStopID() {
		return stopID;
	}

	public void setStopID(int stopID) {
		this.stopID = stopID;
	}

	public int getServiceType() {
		return serviceType;
	}

	public void setServiceType(int serviceType) {
		this.serviceType = serviceType;
	}
}
